Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularized getting of CMake options #3487

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Crivella
Copy link
Contributor

This PR aims to be a followup of:

by modularizing not only the getting of the CMake options for Python but all of them.
The idea is to allow other easyblocks inheriting from CMakeMake to get the same options as in the base easyblock without having to call the configure method first.

An example usecase where this would be useful is the new LLVM easyblock:

where due to the complex logic across stages of compilation it is handy to have all the options in a dict instead of working with self.cfg and configopts.
This still cannot be achieved by just storing the options in a class variable as in #3463 as other options needs to be set beside the base one before running CMake

The only minor distinction in the new function is the setting of BUILD_SHARED_LIBS which should not alter the behavior of CMakeMake as options already set in configopts will take precedence over those in options (

new_opts = ' '.join('-D%s=%s' % (key, value) for key, value in config_opts.items()
if '-D%s=' % key not in cfg_configopts)
)

Manually tested with:

  • GROMACS-2023.3-foss-2023a.eb
  • btllib-1.7.0-GCC-12.3.0.eb
  • CVXPY-1.4.2-foss-2023a.eb
  • FlexiBLAS-3.3.1-GCC-12.3.0.eb
  • fmt-10.0.0-GCCcore-12.3.0.eb
  • googletest-1.13.0-GCCcore-12.3.0.eb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant